package yao.guava.collection;

import java.util.Collection;

import org.junit.Test;

import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.google.common.collect.Sets;
public class CollectionTest {
	
	
	
	
	
	@Test
	public void filter() {
		Collection<Integer> list = Sets.newHashSet(1,2,3,4);
		Collection<Integer> filter = Collections2.filter(list, new Predicate<Integer>(){
			@Override
			public boolean apply(Integer input) {
				if(input == 1) {
					return false;
				}
				return true;
			}						
		});
		System.out.println(list.hashCode());
		System.out.println(filter.hashCode());
		
		
		
	}
	
	
	
	
	
	
	
	

}
